package me.liuyu2783.dubbo.spi;

import java.util.ServiceLoader;

/**
 * me.liuyu2783.dubbo.sample.spi
 *
 * @author liuyu07
 * @date 2020-2-28
 * 缺陷：一次加载所有的实现类，
 */
public class TestJdkSpi {

    public static void main(String[] args) {

        ServiceLoader<PetService> petServices = ServiceLoader.load(PetService.class);
        for(PetService petService: petServices){
            petService.getPetName();
        }
    }
}
